feat(ci): run self-adapter gates on PRs (closes #25) - #42
Merged
Conversation
.claude/workflows/*.js mix ESM-only `export` syntax with top-level `return`/`await`, so they're valid as neither plain CommonJS nor plain ESM and `node --check` can't validate them. Strip the `export` keywords, wrap the body in an async IIFE, and parse (not execute) it with vm.Script so real syntax errors still surface without needing the harness globals (agent, phase, log, ...) to be defined. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WNHtY86twXHEKsLEucSJyY
The `gates` job reads the default, placeholder adapter (.claude/gates.json), whose commands are empty for this repo and so every check skips green. That leaves harness (.claude/**) and docs (docs/**) changes with no real server-side gate. Add a second `self-gates` job that runs build/lint/test through the self adapter (.claude/self/gates.json), whose checks are actually implemented, without touching the existing placeholder job. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WNHtY86twXHEKsLEucSJyY
robercano
approved these changes
Jul 3, 2026
This was referenced Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Runs the self-adapter gates server-side on PRs to this repo, so
.claude/**anddocs/**changes are gated in CI (the root placeholder.claude/gates.jsonhas empty gates → skip).Changes
.github/workflows/gates.yml— adds aself-gatesjob (matrix[build, lint, test], checks namedself / build|lint|test) that runsGATES_FILE=.claude/self/gates.json bash .claude/scripts/gate.sh <gate>onpull_request. The existing placeholder-adaptergatesjob is left intact..claude/self/checks.sh— replaces thenode --checkloop over.claude/workflows/*.jswith a parse-only check (stripexport/import, wrap in an async IIFE to legalize top-levelawait/return, compile withvm.Script).node --checktreated the ESM/DSLfeature-fanout.jsas CommonJS and failed onexport;node --input-type=module --checkstill failed on the top-levelreturn. The new check still catches real syntax errors in both CJS and ESM/workflow files.This also unblocks the previously-RED self
lint/testgates onmain(they choked onfeature-fanout.js), so the new CI job is green on its own PR.Gated locally via the self adapter (build/lint/test all exit 0) and reviewed through the correctness + tests lenses (both approve).
closes #25